package test.medallia;

public class Meda {

	public static void main(String[] args) {
		System.out.println(invert(100));
	}
	
	public static int invert(int n) {

	    int num = n;
	    int digits = 1;

	    
	    
	    while((num = num / 10) >= 10) {
	        digits++;
	    }

	    int inv = 0;
	    int rest = 0;
	    
	    while (n >= 10)  {
	    
	        rest = n % 10;
	        n = n / 10;
	        inv = inv + (int) Math.pow(10, digits) * rest;
	        digits--;
	    }
	    
	    inv += n;
	    
	    return inv;
	}
}
